/**********************************************************************************************************************
 *
 * Project:    mGameEngine
 * File:       ambientlight.cpp
 * Author:     karooolek
 * Created on: 2009-03-27
 *
 **********************************************************************************************************************/

#include "ambientlight.h"

namespace mGameEngine
{
namespace Graphics
{

AmbientLight::AmbientLight() : _ambient(0.0f, 0.0f, 0.0f)
{
}

AmbientLight::AmbientLight(const Color &ambient) : _ambient(ambient)
{
}

AmbientLight::~AmbientLight()
{
}

void AmbientLight::set(uint l) const
{
    if(!_enabled)
    {
        return;
    }

    l += GL_LIGHT0;
    glLightfv(l, GL_AMBIENT, _ambient);
    glLightfv(l, GL_DIFFUSE, Color());
    glLightfv(l, GL_SPECULAR, Color());
    glLightf(l, GL_SPOT_CUTOFF, 0.0f);
    glLightf(l, GL_SPOT_EXPONENT, 0.0f);
}

}
}
